package com.sjz.bookmark.start;

import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.wm.ex.ToolWindowManagerListener;
import com.intellij.util.messages.MessageBusConnection;
import com.sjz.bookmark.listener.BookmarkWindowListener;

public class BookmarkWindowListenerService {

    public BookmarkWindowListenerService() {
        // 获取 MessageBus 连接
        MessageBusConnection connection = ApplicationManager.getApplication().getMessageBus().connect();

        // 注册监听器
        connection.subscribe(ToolWindowManagerListener.TOPIC, new BookmarkWindowListener());
    }
}